<div class="page-header">
  <h3>用户信息</h3>
</div>

<form class="form-horizontal" role="form">
  <div class="form-group">
    <label for="" class="col-sm-2 control-label">用户名</label>
    <div class="col-sm-10">
      <%= @user.login %>
    </div>
  </div>
  <div class="form-group">
    <label for="" class="col-sm-2 control-label">姓名</label>
    <div class="col-sm-10">
      <%= @user.name %>
    </div>
  </div>
  <div class="form-group">
    <label for="" class="col-sm-2 control-label">邮箱</label>
    <div class="col-sm-10">
      <%= @user.email %>
    </div>
  </div>

  <div class="form-group">
    <label for="" class="col-sm-2 control-label">部门</label>
    <div class="col-sm-10">
      <%= @user.try(:department).try(:name) %>
    </div>
  </div>

  <div class="form-group">
    <label for="" class="col-sm-2 control-label">办公电话</label>
    <div class="col-sm-10">
      <%= @user.office_phone %>
    </div>
  </div>

  <div class="form-group">
    <label for="" class="col-sm-2 control-label">手机号码</label>
    <div class="col-sm-10">
      <%= @user.mobile %>
    </div>
  </div>

  <div class="form-group">
    <label for="" class="col-sm-2 control-label">角色</label>
    <div class="col-sm-10">
      <% @user.groups.each do |group| %>
        <span class="label label-success"><%=group.name %></span>
      <% end %>
    </div>
  </div>

  <div class="form-group">
    <label for="" class="col-sm-2 control-label">上次登录时间</label>
    <div class="col-sm-10">
      <%= @user.last_sign_in_at %>
    </div>
  </div>

  <div class="form-group">
    <label for="" class="col-sm-2 control-label">上次登录时间</label>
    <div class="col-sm-10">
      <%= @user.last_sign_in_ip %>
    </div>
  </div>
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <a href="<%= edit_admins_account_path(@user) %>" class='btn btn-primary'>编辑</a>
    </div>
  </div>
</form>